home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Click 1 (Special Issue) / fantasy.iso / Demo The Druid King / DemoMap.pak / SEQUENCES_S01_REPAIR_WKORTHE.VS < prev    next >
Text File  |  2001-04-11  |  708b  |  33 lines

  1. //void
  2.  
  3. ObjList Wkorthe;
  4. int i;
  5. bool bRepaired;
  6. TRect rc;
  7.  
  8. //damage the buildings
  9.     rc.Set(661, 4368, 1737, 6371);
  10.     Wkorthe.AddBuildingsInRect(rc, 1);
  11.     if (Wkorthe.Count() != 5) pr("Not all 5 Wkorthe houses have been found");
  12.     for (i=0; i<5; i+=1) {
  13. //        Wkorthe[i].Damage(3*Wkorthe[i].maxhealth / 4);
  14.         Wkorthe[i].Damage(Wkorthe[i].maxhealth);
  15.     }
  16.  
  17. //wait until they are repaired
  18.  
  19.     while (1) {
  20.         bRepaired = true;
  21.         for (i=0; i<5; i+=1) {
  22.             if (Wkorthe[i].health != Wkorthe[i].maxhealth) {
  23.                 bRepaired = false;
  24.                 break;
  25.             }
  26.         }
  27.         if (bRepaired) break;
  28.         Sleep(3000);
  29.     }
  30.  
  31. //Wkorthe is repaired
  32.     EnvWriteInt("/s01/WkortheRepaired", 1);
  33.     EnvWriteInt("/Note2", 0);